# coding=utf-8
from src.response.BaseModel import BaseModel


class LayR(BaseModel):
    def __init__(self):
        self.code = 200
        self.msg = "ok"
        self.data = None
        self.count = 0

    def ok(self, data=None, count=0, msg="ok", code=0):
        self.data = data
        self.count = count
        self.msg = msg
        self.code = code
        return self.to_dict()

    def error(self, data=None, count=0, msg="error"):
        self.data = data
        self.count = count
        self.msg = msg
        self.code = 500
        return self.to_dict()

